<%@ page language="java" import="java.util.*,com.ncp.model.biz.product.*,com.ncp.model.dao.*,com.ncp.model.entity.product.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
ProductUpdateBean pub = (ProductUpdateBean)request.getAttribute("pub");


%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'updateItem.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
  <script text="text/JavaScript">
<!--
function abc(){

   return window.confirm("你真的要删除该种类名称吗,注意哦！！连属于这个种类的产品也会删除哦"); 
}

String.prototype.Trim = function() 
{ 
return this.replace(/\s/g,""); 
} 

function check(){ 
	  var P_update=document.form_test.update.value;
	  var update=P_update.Trim();
	  var type=document.form_test.type.value;
	   var reg1 = /^[\d\%\.]{1,}$/;
	   var reg2 = /^[1-9]\d{0,}/;
   if(type=="RetailPrice"||type=="MarketPrice"||type=="ProductDiscount"){
     if(!update.match(reg1)){
	  window.alert("请输入正确的数字(有小数部分，最多有两位)");
	 document.form_test.update.focus();
	 return false;
	 }
   }
   else if(type=="CurrentPNumber"){
    	
    if(!update.match(reg2)){
	  window.alert("请输入正确的整数)");
	 document.form_test.update.focus();
	 return false;
	 }
	 
   }
   else{
    if(update==""){
     window.alert("输入内容不能为空！");
	 document.form_test.update.focus();
	 return false;
	 
   }
   }
  }

-->
</script>
  </head>
  
  <body>
  <form action="ManagerBasicUpdServlet?type=<%=pub.getType()%>" method="post" name="form_test">
  <table width="100%" border="1">
  <tr>
    <td width="20%" height="37"><input type="hidden" name="ProductID" value="<%=pub.getProductID()%>" >
    <input type="hidden" name="type" value="<%=pub.getType() %>" >原来信息：<%=pub.getValue() %></td>
    <td width="8%">修改为：</td>
    <td width="72%"><input type="text" name="update" id="textfield3" />
    
    
    </td>
  </tr>
  
  <tr>
    <td><input type="submit" name="Submit" value="确定" onclick="return(check())"/></td>
    <td colspan="2"><input type="reset" name="Submit2" value="重置" /></td>
  </tr>
</table>
</form>
  </body>
</html>
